#pragma once
#include <autoconf.h>
#include <board_id.h>
#include <arch/s3c24xxreg.h>


#define UART_NUM         3

#define INIT_STACK_BASE	 0x1000

#define SVC_STACK_BASE   (SDRAM_BASE + SDRAM_SIZE)
#define SVC_STACK_SIZE   0x00080000

#define UND_STACK_BASE   (SVC_STACK_BASE - 1 * SVC_STACK_SIZE)
#define UND_STACK_SIZE   SVC_STACK_SIZE

#define ABT_STACK_BASE   (SVC_STACK_BASE - 2 * SVC_STACK_SIZE)
#define ABT_STACK_SIZE   SVC_STACK_SIZE

#define IRQ_STACK_BASE   (SVC_STACK_BASE - 3 * SVC_STACK_SIZE)
#define IRQ_STACK_SIZE   SVC_STACK_SIZE

#define FIQ_STACK_BASE   (SVC_STACK_BASE - 4 * SVC_STACK_SIZE)
#define FIQ_STACK_SIZE   SVC_STACK_SIZE

#define GBIOS_STACK_BASE  SVC_STACK_BASE
#define GBIOS_STACK_LIMIT (FIQ_STACK_BASE - FIQ_STACK_SIZE)


#define NAND_PAGE_SIZE     512
#define NAND_PAGE_MASK     (NAND_PAGE_SIZE - 1)
#define NAND_BLOCK_SIZE    (NAND_PAGE_SIZE * 32)
#define NAND_CHIP_SIZE     (64 << 20)

#define	GBIOS_BH_OFFSET	   1

// # fixme
#define CONF_MACH_ID 2318

#ifdef CONF_MACH_ID
#define MACH_ID       CONF_MACH_ID
#elif defined(CONF_S3C2410)
#define MACH_ID       MACH_TYPE_SMDK2410
#elif defined(CONF_S3C2440)
#define MACH_ID       MACH_TYPE_S3C2440
#else
#error
#endif


// fixme
#define ATAG_BASE          SDRAM_BASE

#define INITRD_BASE_ADDR   (SDRAM_BASE + SDRAM_SIZE / 4)
#define INITRD_MAX_SIZE    (SDRAM_SIZE / 4)

#define LINUX_BASE_ADDR    (INITRD_BASE_ADDR + SDRAM_SIZE / 4)
#define LINUX_MAX_SIZE     (SDRAM_SIZE / 4)

#define CURR_UART_BASE   (UART0_BASE + CONF_UART_INDEX * 0x4000)

